<template>
    <div>
        <el-header style="font-size: 20px;position: relative;left: -20px;top: 20px" v-if="checkRoute">
            <i class="el-icon-user"></i>/费用减免信息
        </el-header>
        <div class="message">
            <div style="padding: 10px" class="grid-content bg-purple"><span>案号:</span><br>{{rows.caseNo}}</div>
            <div style="padding: 10px" class="grid-content bg-purple"><span>委托人:</span><br>{{caseDecrease.caseWtr}}</div>
            <div style="padding: 10px" class="grid-content bg-purple"><span>提交人:</span><br>{{caseDecrease.caseSubmitter}}</div>

            <div v-if="rowss.type.indexOf('费用减免')!=-1" style="padding: 10px"  class="grid-content bg-purple">
                <div><span>减免金额:</span><br>{{caseDecrease.decreaseMoney}}</div>
            </div>
            <div v-if="rowss.type.indexOf('退款')!=-1" style="padding: 10px"  class="grid-content bg-purple">
                <div><span>退款金额:</span><br>{{caseDecrease.decreaseMoney}}</div>
            </div>
            <div style="padding: 10px" class="grid-content bg-purple"><span>申请日期:</span><br>{{caseDecrease.applyDate}}</div>
            <div style="padding: 10px" class="grid-content bg-purple"><span>减免事由:</span><br>{{caseDecrease.reason}}</div>
            <div style="padding: 10px" class="grid-content bg-purple"><span>退款申请单:</span><br>
                <a style="color: #5daf34" :href="url">下载退款申请单</a></div>
            <div style="padding: 10px" class="grid-content bg-purple"><span>备注:</span><br>{{caseDecrease.caseParties}}</div>
        </div>
    </div>
</template>

<script>

    import {CaseDecreaseService} from '../../../model/gs/CaseDecreaseService.js'
    var caseDecreaseService = CaseDecreaseService.getInstance()


    export default {
        name: "FeeRemission",
        props:['rows'],
        data(){
            return{
                rowss:this.rows,
                caseDecrease:{},
                url:''
            }
        },
        watch:{
            rows:function () {
                this.rowss=this.rows

            }
        },
        methods:{
            selectByCaseLaw(){
                var a ={};
                a.wid=this.rowss.wid
                a.type=this.rowss.type
                caseDecreaseService.selectByCaseLaw(a).then(response=>{
                    this.caseDecrease=response.data.data
                    this.url = 'http://localhost/download?url=https://qy-file-bucket.oss-cn-beijing.aliyuncs.com/RecordDocument/bdd6e47c-172d-4e04-a823-52b3cc3a437b.doc?Expires=1927089124&OSSAccessKeyId=LTAI4GCXS6Qi9BqpB7S55n3u&Signature=iZc4fbjxCWEID48mDgROzstxStg%3D&name=退款申请单&token='+this.token

                })
            }
        },
        computed:{
            checkRoute:{
                get(){
                    return this.$route.path == '/Mybacklog'
                }
            },
            token:{
                get(){
                    return this.$store.state.token
                }
            }
        },
        created(){
            this.selectByCaseLaw()
        }
    }
</script>

<style scoped>
    .message{
        display: flex;
        flex-wrap: wrap;
        width: 100%;
    }
    .bg-purple {
        background: #FFFFFF;
        border: 1px solid   darkgray;
        width: 23.5%;
        height: 50px;
    }
</style>
